// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   yx.java

package com.zelix;

import java.util.*;

// Referenced classes of package com.zelix:
//            zw, px, ly

public class yx
{

    private ly a;
    private String b[];
    private Hashtable c;
    public static boolean d;
    private static String z;

    public yx(ly ly1, ly ly2)
    {
        super();
        int i;
        Enumeration enumeration;
        boolean flag;
        flag = d;

        c = new Hashtable();
        a = ly1;
        b = new String[ly2.c()];
        i = 0;
        enumeration = ly2.b();
        if(!flag) goto _L2; else goto _L1
_L1:
        b[i++] = (String)enumeration.nextElement();
_L2:
        if(!enumeration.hasMoreElements())
        {
            Arrays.sort(b, zw.a());
            return;
        }
        if(true) goto _L1; else goto _L3
_L3:
    }

    public boolean a(String s)
    {
        if(a != null)
        {
            String s1 = s;
            if(s1.charAt(0) == '/')
                s1 = s1.substring(1);
            if(s1.charAt(s1.length() - 1) == '/')
                s1 = s1.substring(0, s1.length() - 1);
            return a.a(s1);
        } else
        {
            return false;
        }
    }

    public String a(String s, ly ly1)
    {
        String s1;
        String s2;
        String s5;
        int j;
        boolean flag;
        flag = d;
        if(ly1 == null)
            break MISSING_BLOCK_LABEL_210;
        int i = s.indexOf(z);
        s1 = s.substring(0, i);
        s2 = "";
        if(s1.charAt(0) == '/')
        {
            s1 = s1.substring(1);
            s2 = "/";
        }
        String s3 = (String)ly1.b(s1);
        if(s3 != null)
        {
            String s4 = s2 + s3 + z;
            return s4;
        }
        s5 = "";
        j = b.length - 1;
        if(!flag) goto _L2; else goto _L1
_L1:
        if(!s1.startsWith(b[j]))
            continue; /* Loop/switch isn't completed */
        s5 = b[j];
        if(!flag)
            break; /* Loop/switch isn't completed */
        j--;
_L2:
        if(j >= 0) goto _L1; else goto _L3
_L3:
        if(s5.length() > 0)
        {
            String s6 = s2 + s5 + px.a(s1.substring(s5.length()), ly1) + z;
            return s6;
        }
        return s;
    }

    public String b(String s)
    {
        if(a != null)
        {
            String s1 = s;
            String s2 = "";
            String s3 = "";
            if(s1.charAt(0) == '/')
            {
                s1 = s1.substring(1);
                s2 = "/";
            }
            if(s1.charAt(s1.length() - 1) == '/')
            {
                s1 = s1.substring(0, s1.length() - 1);
                s3 = "/";
            }
            String s4 = (String)a.b(s1);
            if(s4 != null)
                return s2 + s4 + (s4.length() <= 0 ? "" : s3);
            else
                return s;
        } else
        {
            return s;
        }
    }

    public static String b(String s, ly ly1)
    {
        String s1;
        String s2;
        String s3;
        boolean flag;
label0:
        {
            flag = d;
            if(ly1 == null)
                return s;
            s = s.trim();
            int i = s.lastIndexOf('/');
            if(i <= 0)
                return s;
            s1 = s.substring(i);
            s2 = s.substring(0, i);
            if(s2.length() > 0 && s2.charAt(0) == '/')
            {
                s3 = "/";
                s2 = s2.substring(1);
                if(!flag)
                    break label0;
            }
            s3 = "";
        }
        StringBuffer stringbuffer = new StringBuffer(s2);
        do
        {
            String s4 = stringbuffer.toString();
            String s5 = (String)ly1.b(s4);
            if(s5 != null)
            {
                if(!s5.equals(s4))
                {
                    StringBuffer stringbuffer1 = new StringBuffer(s5);
                    String s6 = s2.substring(s4.length());
                    if(stringbuffer1.length() == 0 && s6.length() > 0 && s6.charAt(0) == '/')
                        s6 = s6.substring(1);
                    stringbuffer1.append(s6);
                    if(stringbuffer1.length() == 0)
                        s1 = s1.substring(1);
                    return s3 + stringbuffer1.toString() + s1;
                }
                break;
            }
            int j = s4.lastIndexOf("/");
            if(j <= -1)
                break;
            stringbuffer.setLength(j);
        } while(!flag);
        return s;
    }

    public static String a(String s, String s1, ly ly1)
    {
label0:
        {
            String s4;
            String s6;
            String s7;
label1:
            {
                boolean flag = d;
                s = s.trim();
                s1 = s1.trim();
                if(s.length() > 0 && s.charAt(0) == '/')
                    s = s.substring(1);
                int i = s.lastIndexOf('/');
                if(i <= 0)
                    return s1;
                String s2 = s.substring(0, i);
                StringBuffer stringbuffer = new StringBuffer(s2);
                String s3 = null;
                s4 = null;
                do
                {
                    String s5 = stringbuffer.toString();
                    s4 = (String)ly1.b(s5);
                    if(s4 != null)
                    {
                        s3 = s5.toString();
                        break;
                    }
                    int j = s5.lastIndexOf("/");
                    if(j <= -1)
                        break;
                    stringbuffer.setLength(j);
                } while(true);
                if(s3 == null || s3.equals(s4))
                    break label0;
                s6 = s.substring(s3.length() + 1);
                if(s6.length() >= s1.length())
                    return s1;
                int k = s.indexOf(s1);
                if(k > 0)
                {
                    String s8 = s.substring(0, k - 1);
                    s7 = (String)ly1.b(s8);
                    if(!flag)
                        break label1;
                }
                s7 = "";
            }
            if(s7.length() < s4.length())
            {
                String s9 = s4.substring(s7.length() + (s7.length() != 0 ? 1 : 0));
                return s9 + "/" + s6;
            } else
            {
                return s6;
            }
        }
        return s1;
    }

    public String c(String s)
    {
        String s2;
        String s3;
        String s4;
        String s6;
        int j;
        boolean flag;
        flag = d;
        if(a == null)
            break MISSING_BLOCK_LABEL_483;
        String s1 = s;
        s2 = "";
        if(s1.charAt(0) == '/')
        {
            s1 = s1.substring(1);
            s2 = "/";
        }
        int i = s1.lastIndexOf('/');
        if(i < 0)
            break MISSING_BLOCK_LABEL_483;
        s3 = s1.substring(i + 1);
        s4 = s1.substring(0, i);
        String s5 = (String)c.get(s4);
        if(s5 != null)
            return s2 + s5 + (s5.length() <= 0 ? "" : "/") + s3;
        s6 = "";
        j = b.length - 1;
        if(!flag) goto _L2; else goto _L1
_L1:
        if(!s4.startsWith(b[j]))
            continue; /* Loop/switch isn't completed */
        s6 = b[j];
        s4 = s4.substring(b[j].length());
        if(!flag)
            break; /* Loop/switch isn't completed */
        j--;
_L2:
        if(j >= 0) goto _L1; else goto _L3
_L3:
        StringBuffer stringbuffer = new StringBuffer(s4);
        do
        {
            String s7 = stringbuffer.toString();
            String s8 = (String)a.b(s7);
            if(s8 != null)
            {
                StringBuffer stringbuffer1 = new StringBuffer(s8);
                String s9 = s4.substring(s7.length());
                if(stringbuffer1.length() == 0 && s9.length() > 0 && s9.charAt(0) == '/')
                    s9 = s9.substring(1);
                stringbuffer1.append(s9);
                c.put(s6 + s4, s6 + stringbuffer1.toString());
                if(stringbuffer1.length() > 0)
                    stringbuffer1.append("/");
                stringbuffer1.append(s3);
                return s2 + s6 + stringbuffer1.toString();
            }
            int k = s7.lastIndexOf("/");
            if(k <= -1)
                break;
            stringbuffer.setLength(k);
        } while(!flag);
        c.put(s6 + s4, s6 + s4);
        return s;
    }

    private static String z(char[] chs) {
        for (int i = 0; i < chs.length; i++) {
            byte key = 0;
            switch (i % 5) {
                case 0:
                    key = 0x35;
                    break;
                case 1:
                    key = 40;
                    break;
                case 2:
                    key = 27;
                    break;
                case 3:
                    key = 72;
                    break;
                default:
                    key = 98;
                    break;
            }
            chs[i] ^= key;
        }
        return new String(chs).intern();
    }

    static
    {
        z = z("\033Kw)\021F".toCharArray());
    }
}
